package org.ajc.gift.domain;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.experimental.FieldDefaults;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author ajc
 * @since 2024-03-22
 */
@TableName("t_employee")
public class Employee extends Model<Employee> {

    private static final long serialVersionUID = 1L;

    private Long id;
    private String name;
    @TableField("dep_id")
    private Integer depId;
    //注意：如果该属性不是表中的字段需要打上注解@TableField(exist = false) 指明这不是表中的字段
    @TableField(exist = false)
    private Department department;

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getDepId() {
        return depId;
    }

    public void setDepId(Integer depId) {
        this.depId = depId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", depId=" + depId +
                ", department=" + department +
                '}';
    }
}
